Skip to content

[NEW] CX Agent Expansion#60

Merged
ear-dev merged 11 commits into
cx_developmentfrom
cx_agent_expansion
Jun 8, 2021
Merged

[NEW] CX Agent Expansion#60
ear-dev merged 11 commits into
cx_developmentfrom
cx_agent_expansion

Conversation

@AlexanderKanakis

Copy link
Copy Markdown
Collaborator

Changes

  1. Added switch that changes the routing between ES and CX agents.
  2. Changes the HTTP request for CX agents.
  3. Set up authentication necessary for CX agent.
  4. Set up message parsing specifically for CX agent responses.
  5. Added documentation for setting up a Dialogflow CX agent in Omnichannel.

@AlexanderKanakis AlexanderKanakis changed the title Cx agent expansion [NEW] Cx agent expansion May 15, 2021
@AlexanderKanakis AlexanderKanakis changed the title [NEW] Cx agent expansion [NEW] CX Agent Expansion May 15, 2021
@ear-dev ear-dev requested a review from Shailesh351 May 17, 2021 18:04
@ear-dev

ear-dev commented May 17, 2021

Copy link
Copy Markdown

Thanks @AlexanderKanakis

2 small things please...

  • Is it possible to put the new config items at the top of the list in the UI, instead of at the bottom. I'm thinking that the choice of ES vs. CX should be topmost config.
  • Can you indicate please in a comment on these fields that they are required for ES only?
    image
    Thanks.

e

@ear-dev

ear-dev commented May 17, 2021

Copy link
Copy Markdown

Also..... is this a typo? Not sure it makes sense to have this labeled [CX ONLY] and to suggest that it's not for CX.... :-)

image

Dialogflow CX does not use fallback events. This setting lists events that will be treated AS fallbacks by our Apps.Dialogflow. I can change the description and label to make this more clear.

@ear-dev

ear-dev commented May 17, 2021

Copy link
Copy Markdown

@AlexanderKanakis How does authentication work? thanks

@ear-dev

ear-dev commented May 17, 2021

Copy link
Copy Markdown

"Agent Version" at the top.... toggles between ES/CX

  • CX Settings
    • CX only settings under this heading
  • ES Settings
    • ES only settings under this heading
  • General Settings
    • All the common settings under this heading

Thoughts?

@AlexanderKanakis

AlexanderKanakis commented May 18, 2021

Copy link
Copy Markdown
Collaborator Author

Thanks @AlexanderKanakis

2 small things please...

* Is it possible to put the new config items at the top of the list in the UI, instead of at the bottom.  I'm thinking that the choice of ES vs. CX should be topmost config.

* Can you indicate please in a comment on these fields that they are required for ES only?
  ![image](https://user-images.githubusercontent.com/28864717/118545620-d4b0e300-b724-11eb-855e-b07acd9312ad.png)
  Thanks.

e

All of these settings are necessary for CX as well. There are only some CX exclusive.

@AlexanderKanakis

AlexanderKanakis commented May 18, 2021

Copy link
Copy Markdown
Collaborator Author

@AlexanderKanakis How does authentication work? thanks

ES authenticates by sticking an access token as a URL parameter in its requests.
https://dialogflow.googleapis.com/v2/projects/${projectId}/agent/environments/${environment || 'draft'}/users/-/sessions/${sessionId}:detectIntent?access_token=${accessToken}

CX authenticates by placing the access token in the request's header.

{ 'Content-Type': Headers.CONTENT_TYPE_JSON, 'Accept': Headers.ACCEPT_JSON, 'Authorization': 'Bearer ' + accessToken },
   { queryInput },
);```

@ear-dev

ear-dev commented May 18, 2021

Copy link
Copy Markdown

How do we configure the authentication token in CX? For ES there is an input box, do we need something similar for CX?

@AlexanderKanakis

AlexanderKanakis commented May 18, 2021

Copy link
Copy Markdown
Collaborator Author

The authentication token in ES is configured with the private key and the client email. We get the authentication token in CX in the exact same way.

EDIT: It occured to me that the ES and CX agent might not be part of the same service as it is in my case. I will add the same fields (project id, client email, private key) as an optional input for CX, just in case the two agents are not part of the same service.

@ear-dev

ear-dev commented May 18, 2021

Copy link
Copy Markdown

Ah, cool..... thanks. I think we can make some UI improvements here, and you probably saw the story I created about it. Let me know what you think. thanks.

@chadgoss

Copy link
Copy Markdown
Collaborator

Dialogflow CX does not use fallback events

Lets discus at standup, but I dont think we want the RC DF app doing an conversation manipulation

@ear-dev

ear-dev commented Jun 2, 2021

Copy link
Copy Markdown

@Shailesh351 please review when you can....... thanks!

@Shailesh351 Shailesh351 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally this PR Looks good to me. Nice work @AlexanderKanakis 🎉

I found that there are lint in some files. We have tslint configured in the project. You can use it for fixing lint issues.

Thanks!

Comment thread config/Settings.ts Outdated
Comment thread enum/Dialogflow.ts Outdated
Comment thread lib/payloadAction.ts Outdated
Comment thread lib/payloadAction.ts Outdated
await closeChat(modify, read, rid);
}
else if (actionName === ActionIds.SET_TIMEOUT) {
let n = setTimeout(async () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setInterval, setTimeout is not supported in The RC Apps currently. For reference RocketChat#30

They do have Schedular API https://developer.rocket.chat/apps-development/fundamentals-of-apps/scheduler-api

@AlexanderKanakis

Copy link
Copy Markdown
Collaborator Author

Functionally this PR Looks good to me. Nice work @AlexanderKanakis tada

I found that there are lint in some files. We have tslint configured in the project. You can use it for fixing lint issues.

Thanks!

Issues resolved in new commit!

Comment thread app.json Outdated

@Shailesh351 Shailesh351 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@ear-dev

ear-dev commented Jun 8, 2021

Copy link
Copy Markdown

Thanks @AlexanderKanakis @Shailesh351 !

@ear-dev ear-dev merged commit 1a9ccf8 into cx_development Jun 8, 2021
github-actions Bot pushed a commit that referenced this pull request Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants